package com.baizhi.mall.service.impl;

import com.baizhi.mall.entity.mysql.LogDO;
import com.baizhi.mall.mapper.LogMapper;
import com.baizhi.mall.service.ILogService;
import com.baizhi.mall.util.PageUtils;
import com.baizhi.mall.util.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lidn
 * @since 2021-05-11
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, LogDO> implements ILogService {

    @Override
    public PageUtils selectAllByPage(Map<String, Object> param) {
        IPage<LogDO> logDOIPage = this.baseMapper.selectPage(new Query<LogDO>().getPage(param),
                new QueryWrapper<LogDO>().like(null != param.get("username"), "username", param.get("username")));
        return new PageUtils(logDOIPage);
    }
}
